package org.jivesoftware.smackx.pubsub.packet;

import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.pubsub.PubSubElementType;

public class PubSub extends IQ
{
  private PubSubNamespace ns = PubSubNamespace.BASIC;

  public String getChildElementXML()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append("\">");
    localStringBuilder.append(getExtensionsXML());
    localStringBuilder.append("</").append(getElementName()).append(">");
    return localStringBuilder.toString();
  }

  public String getElementName()
  {
    return "pubsub";
  }

  public PacketExtension getExtension(PubSubElementType paramPubSubElementType)
  {
    return getExtension(paramPubSubElementType.getElementName(), paramPubSubElementType.getNamespace().getXmlns());
  }

  public String getNamespace()
  {
    return this.ns.getXmlns();
  }

  public PubSubNamespace getPubSubNamespace()
  {
    return this.ns;
  }

  public void setPubSubNamespace(PubSubNamespace paramPubSubNamespace)
  {
    this.ns = paramPubSubNamespace;
  }
}